Switching circuit and a method of operation thereof

ABSTRACT

This invention relates to a switching circuit, such as a bridge circuit, comprising first and second switches operable to produce an electrical signal at the output of the switching circuit at certain voltages. Moreover, this invention also relates to a method of operating such a switching circuit. The switching circuit comprises an input operable to receive a DC signal of +Vs, an output, first and second switches operable in response to first and second switching signals to be switched between on and off states such that switching between various combinations of on and off states produces an electrical signal at the output with voltage pulses at levels of +Vs, 0V and −VS and a voltage sensor for producing a signal indicative of a voltage offset in the switching circuit. Voltage effects in the switching circuit can be compensated for by using the signal produced by the voltage sensor.

This application is the US national phase of international application PCT/GB02/05733 filed in English on 17 Dec. 2002, which designated the U.S. PCT/GB02/05733 claims priority to GB Application No. 0200024.8 filed 2 Jan. 2002. The entire contents of these applications are incorporated herein by reference.

BACKGROUND OF THE INVENTION

1. Field of the Invention

This invention relates to a switching circuit comprising first and second switches operable to produce an electrical signal at the output of the switching circuits at certain voltages. Moreover, this invention also relates to a method of operating such a switching circuit.

The switching circuit may comprise a bridge circuit operated to produce a voltage across a load connected to an output of the bridge circuit in accordance with a required voltage. For example, a presently contemplated application of the present invention is in driving an electromagnet in response to a demanded force produced by the electromagnet that must be met to a very high tolerance. The force produced by the electromagnet can be controlled in response to either current demands or voltage demands, because control of either current or voltage affects the force produced by the electromagnet. In addition, the current controller can be operated in response to force demands, although this must be converted into a current or voltage demand. Even where the current controller is operated in voltage demand mode with demanded voltages being set across the electromagnet, this will of course influence the current flowing through the electromagnet and so the term ‘current controller’ is used to cover operation in response to voltage or current or field demands.

Where the current controller is operated in response to voltage demands, high-frequency voltage pulses may be applied to the electromagnet because the large inductance associated with an electromagnet leads to a slow response time in the current so that it smoothly follows drifts in the average voltage applied across the electromagnet.

A known switching circuit is shown in FIG. 1. As can be seen, the switching circuit comprises a half-bridge circuit with an electromagnet connected across its output. Control of the voltage across the electromagnet is achieved by switching a pair of transistors positioned on opposed arms of the bridge circuit (the other opposed arms containing diodes to complete the half-bridge circuit) to alter the polarity of the voltage across the electromagnet between +V_(S) and −V_(S). A current or voltage demand will be received and switching signals are generated to match this demand. The switching signals are supplied at the points marked A and B to control the transistors such that they are switched between maximum and minimum conducting states (their linear region is not used due to poor power efficiency). The diodes in the half-bridge circuit ensure that current flows in one direction only through the electromagnet, in this case from right to left in FIG. 1. The current controller is operated such that the transistors are switched concurrently: when both transistors are on (i.e. conducting), a voltage of +V_(S) is applied across the electromagnet and when the transistors are off (i.e. non-conducting), a voltage of −V_(S) is applied across the electromagnet. The duty cycles at +V_(S) and −V_(S) determine the average current delivered to the electromagnet in that period, remembering that the inductance of the electromagnet ensures that the current smoothly follows the voltage rather than sharply jumping with each voltage pulse. Hence, by switching the transistors at appropriate times, the desired current can be delivered to the electromagnet. A reservoir capacitor is included to hold current drawn from the electromagnet that cannot be passed back to the DC supply.

The pulsed voltage signal that produces these duty cycles is implemented using pulsed switching signals supplied to the transistors. The switching signals are modulated according to a pulse width modulation scheme according to an analogue-implemented scheme, such that the width of the pulses within a period are varied so that the pulse at +V_(S) is varied relative to the remaining time at −V_(S) to produce the desired current. Alternatively, a pulse density modulation scheme may be used, as is well known in the art.

2. Discussion of Prior Art

A problem with the above described switching circuit is that there are a number of offsets in voltages across various parts of the circuit that will cause the voltage produced across the electromagnet to differ from that required. These voltage offsets may be caused by fluctuations in the DC supply about the nominal value of +V_(S) (both due to mains ripple and the voltage across the reservoir capacitor varying as it charges and discharges, in particular) and by voltage drops across the diodes and transistors caused by their intrinsic resistance. In addition, slow response times in the components causes slow variation in the voltage supplied to the electromagnet that falls behind the required variation. If these effects are not corrected for, the average voltage delivered to the electromagnet during the period will not match the required voltage.

SUMMARY OF THE INVENTION

From a first aspect, the invention resides in a switching circuit comprising an input operable to receive a DC signal of +V_(S), an output, first and second switches operable in response to first and second switching signals to be switched between on and off states such that switching between various combinations of on and off states produces an electrical signal at the output with voltage pulses at levels of +V_(S), 0V and −V_(S) and a voltage sensor for producing a signal indicative of a voltage offset in the switching circuit.

By using the voltage sensor to produce a signal indicative of a voltage offset in the switching circuit, voltage effects in the switching circuit can be compensated for. The information that the voltage sensor measures or interprets may vary according to the use of the switching circuit and to what is connected to the switching circuit.

Optionally, the voltage sensor is arranged to measure fluctuations in the DC signal. Any measured fluctuations in the DC supply may be compensated for by adjusting the relative duty cycles of the output at the three levels V_(S), 0V and −V_(S). This may be implemented by either using a measure of the DC supply itself or by using a measure of the deviation from the nominal +V_(S) voltage of the DC supply.

Advantageously, the voltage sensor may be arranged to produce a signal indicative of a predicted value of the DC signal. This is particularly useful where delays in the voltage sensor lead to an unacceptable lag in the response of the switching circuit to fluctuations in the DC supply. Conveniently, the voltage sensor includes a finite impulse response filter arranged to measure the DC signal.

Preferably, the voltage sensor is operable to produce a signal indicative of a voltage drop across a diode and/or transistor in the switching circuit. Such voltage drops may lead to discrepancies in the voltage supplied to the output away from a desired voltage.

Conveniently, the voltage sensor may be arranged to measure the current flowing through the output and, optionally, the voltage sensor may be operable to produce a signal indicative of a voltage drop across a diode and/or transistor of the switching circuit with reference to a measurement of the current flowing through the output and a value of the resistance of the diode and/or transistor. This is, of course, using the well known relationship of Ohm's Law, namely V=IR, and will provide a measure of a voltage drop across a diode or transistor that reflects the current flowing through that diode or transistor. If this accuracy is not required, the voltage sensor may merely produce a representative voltage drop for the diode or transistor irrespective of the current flowing through the diode or transistor at that time.

Optionally, the switching circuit comprises a bridge circuit having an input that receives a DC signal of voltage +V_(S), an output and first and second arms having first and second switches respectively, the first and second arms being connected to opposed ends of the output.

Conveniently, the bridge circuit may be a half-bridge with the third and fourth arms having diodes. Advantageously, the first and second switches may be transistors and, optionally, an electromagnet may be connected across the output of the bridge circuit.

Optionally, the switching circuit may further comprise a noise shaper operable to noise shape the first and second switching signals. This is beneficial where the switching circuit is operated in accordance with a digital switching scheme that gives rise to quantisation noise. This noise is caused due to the pulsed nature of the switching signals that must have their optimum widths assigned to the nearest available width in the PWM quantisation scheme. The almost inevitable difference between the optimum width and the closest available width is the quantisation error, and it is the successive quantisation errors that form the quantisation noise that will be seen in the voltage supplied to the output of the switching circuit. Including a noise shaper is highly advantageous in that it reduces quantisation noise in the first and second switching signals and, hence, in the signal supplied to the output. Noise shaping is achieved by shaping the noise spectrum of the output signal such that there is a suppression of noise at the frequencies of interest. This advantage is achieved at the expense of increased noise at other frequencies outside of the band of interest.

Advantageously, the noise shaper may be a second-order noise shaper, i.e. noise shaper that compensates for the quantisation error in the previous two periods.

According to a second aspect, the invention resides in a method of operating a bridge circuit comprising an input that receives a DC signal of voltage +V_(S), an output having an electromagnet connected thereacross, first and second arms having first and second switches respectively, the first and second arms being connected to opposed ends of the electromagnet, the method comprising the steps of: (a) receiving a voltage demand signal indicative of a desired voltage of an electrical signal to be supplied to the electromagnet in a period; (b) generating first and second switching signals with reference to the voltage demand signal; and (c) applying the first and second switching signals to the first and second switches respectively during the period. The switching signals cause the switches to switch between on and off states, with switching between various combinations of on and off states of the first and second switches producing an electrical signal across the electromagnet with voltage pulses at levels of +V_(S), 0V and −V_(S). The first and second switching signals are generated such that an average voltage of the electrical signal supplied to the electromagnet during the period is substantially equal to the desired voltage.

Using pulses at levels of +V_(S), 0V and −V_(S) allows an average voltage within the range of +V_(S) and −V_(S) to be produced for that period. For example, if a voltage of 0.5V_(S) is desired, then a voltage of +V_(S) can be applied to the electromagnet for half of the period and a voltage of 0V for the other half.

Control of the voltage applied across the electromagnet also controls the average current flowing through the electromagnet for that period. The average current flowing through the electromagnet will vary according both to the voltage across the electromagnet and also the components of the circuit (e.g. inductance of the electromagnet, capacitance in the circuit). In general, a voltage of +V_(S) gives a positive current whilst switching to a voltage of 0V will lead to the current gradually decreasing to zero or negative values whilst switching to −V_(S) will lead to the current rapidly decreasing to zero or negative values. If a full bridge circuit is used, current can flow both ways through the electromagnet (i.e. positive and negative currents), whilst if a half-bridge circuit is used only unidirectional current flow through the electromagnet is possible.

The voltage seen by the electromagnet depends on the states of the first and second switches as follows. When both switches are on, the electromagnet sees a voltage of +V_(S). When both switches are off, the electromagnet sees a voltage of −V_(S). Finally, when one switch is on and the other is off, irrespective of which way round, the electromagnet sees a voltage of 0V.

Using bipolar switching, i.e. switching between three voltage levels +V_(S), 0V and −V_(S), gives advantages over the prior art controller that uses unipolar switching, i.e. switching between +V_(S) and −V_(S) only. For example, an additional one bit of resolution is acquired using bipolar switching for a given timing clock frequency as voltage drops of V_(S) are possible rather than just the voltage drops of 2V_(S) obtained with unipolar switching. Alternatively, the same resolution can be obtained using only half the timing clock frequency.

Preferably, the width of a pulse of the first and/or second switching signals is generated with reference to a voltage signal indicative of the DC signal such that the width of the pulse compensates for fluctuations in the DC supply. Voltage fluctuations in the DC supply will manifest themselves as a pulse amplitude modulation in the voltage seen by the electromagnet and so the desired voltage will not be met by the average voltage seen by the electromagnet over the period. By adding or subtracting width to/from the pulse or pulses of the first and/or second switching signal, the lost or gained amplitude can be compensated for by adjusting the width of the voltage pulse or pulses seen by the electromagnet.

Optionally, the voltage signal is passed through a filter to obtain a predictive measure of fluctuations in the DC supply. This may alleviate problems in the finite response time in relaying the voltage signal and in generating the switching signals for the successive period. The voltage signal may be passed through a finite impulse response filter.

The width of a pulse of the first or second switching signals may be generated to include an addition in width to compensate for a voltage drop across a diode and/or transistor in the bridge circuit. Conveniently, the addition in width may be calculated with reference to a current signal indicative of the current flowing through the electromagnet and a representative resistance of the diode or transistor. If these voltage drops are not compensated for, the voltage seen by the electromagnet will be less than the desired voltage.

Optionally, the width of a pulse of the first or second switching signals is generated to include additional width to compensate for a voltage offset caused by slow response times in the first or second switch. Slowness in the response of the switches will lead to sloping leading and trailing edges of the pulses seen in the voltage supplied to the electromagnet. If the slope is not equal, the average voltage supplied to the electromagnet over the period will not match the desired voltage.

Preferably, the switching circuit comprises a bridge circuit having an input that receives a DC signal of voltage +V_(S), an output and first and second arms having first and second switches respectively, the first and second arms being connected to opposed ends of the output. Advantageously, the bridge circuit may be a half-bridge with the third and fourth arms having diodes. Optionally, the first and second switches may be transistors and the method comprises the step of switching the transistors between on and off states corresponding to substantially maximum and substantially minimum current flow respectively through the transistor. The transistors may be MOSFET transistors, for example.

Optionally, the method may comprise the step of generating pulsed first and second switching signals. This is advantageous as it allows an all-digital implementation. Using pulsed switching signals means that the voltage produced across the electromagnet is also pulsed, although there will be pulses of +V_(S) and −V_(S) relative to the 0V baseline.

Alternatively, a continuously-varying signal could be used with switching of the transistors occurring when the signal exceeds a threshold value. This allows a part-analogue implementation.

Preferably, the method may comprise the step of generating the first and second pulsed switching signals according to a rule that the first and second switches are not switched concurrently. Operating only one switch at a time is advantageous because the voltage drops that occur across the electromagnet may be halved at each switching event. This is particularly advantageous where the voltage drop of 2V_(S) that occurs with the prior art current controller is above or close to the insulation breakdown voltage of the electromagnet. Conversely, adopting bipolar switching allows the bridge circuit to be run from a higher voltage DC source without fear of insulation breakdown upon switching the transistors. Furthermore, the power of the unwanted components in the output waveform at harmonics of the pulse repetition frequency is reduced from a fixed high level to a lower level which drops as the signal drops.

The method may comprise the step of generating the first and second switching signals according to a rule that the signals are to have no more than one pulse per period. Advantageously, this minimises the number of times the switches must be switched, thereby reducing power losses.

Preferably, the method may comprise the step of generating the first and second switching signals according to a rule that any pulse should be positioned symmetrically about the centre of the period. This is so-called uniform pulse width modulation and leads to the electromagnet seeing a voltage that is also symmetric about the centre of the period. Other forms of pulse width modulation are possible, such as leading edge or trailing edge pulse width modulation.

Optionally, the method may comprise the step of generating the first and second switching signals according to the rule that where pulses cannot be centred symmetrically, the longer and shorter sides of the asymmetric pulses are alternated between the leading edge side and the trailing edge side for successive pulses. For example, where a period extends over an even number of timing clock cycles, a pulse occupying an odd number of clock cycles cannot be created symmetrically within the period: one clock cycle must be added either to the leading edge or to the trailing edge of the otherwise symmetric pulse. By performing the method herein defined, noise is suppressed that would otherwise result from adding weight always to the leading edge or always to the trailing edge side.

Optionally, the method may comprise the step of generating the first and second switching signals according to a pulse width modulation scheme. Modulating the switching sequences to a pulse width modulation (PWM) scheme means that the pulsed voltages seen by the electromagnet are also modulated to a PWM scheme. This is because the voltage seen by the electromagnet steps each time there is a pulse edge in either of the switching signals, hence the edge positions of the switching signals determine the edge positions of the voltage across the electromagnet. The switching signals may have a digital modulation (i.e. to two levels with high and low values corresponding to the switches being on/conducting or off/non-conducting), but the combination of on and off switch states in the bridge results in the three levels of the bipolar PWM voltages seen by the electromagnet.

Preferably, the method may comprise the step of noise shaping the first and second switching signals. Advantageously, this noise shaping may be second-order noise shaping, i.e. noise shaping that compensates for the quantisation error in the previous two periods.

Optionally, the method may comprise the step of receiving a current demand signal indicative of a desired current to be supplied to the electromagnet in a period and calculating the voltage demand signal indicative of a desired voltage of an electrical signal to be applied to the electromagnet that results in the electrical signal being supplied to the electromagnet during the period with a current substantially equal to the desired current. In this way, the current controller may take a current demand and operate by calculating a corresponding voltage demand locally.

Optionally, the step of calculating the voltage demand signal is performed with reference to a model of the load characteristic of a load connected to the output. For example, a look-up table may be constructed listing required voltages to generate the desired currents. Alternatively, a polynomial relationship or similar may be derived such that the required voltage can be calculated given a desired current.

Preferably, the step of generating the voltage demand signal may be performed with reference to a current signal indicative of the current flowing through the output. In this way, adjustments may be made to compensate for any difference between the desired current and the actual current measured at the output. One way of achieving this is to calculate the difference between the desired current and actual measured current and subtract this from the current demand signal prior to calculating the voltage demand.

The invention also resides in a computer program comprising program code means for performing the method steps described herein above when the program is run on a computer and/or other processing means associated with the bridge circuit. Furthermore, the invention also resides in a computer program product comprising program code means stored on a computer readable medium for performing the method steps described herein above when the program is run on a computer and/or other processing means associated with the bridge circuit.

BRIEF DESCRIPTION OF THE DRAWINGS

The invention will now be described, by way of example only, by reference to the accompanying drawings in which:

FIG. 1 shows a half-bridge circuit 14;

FIG. 2 is a schematic representation of a current controller according to a first embodiment of the present invention;

FIG. 3 a is a schematic representation of the switching signal generator 28 of FIG. 2;

FIG. 3 b is a schematic representation of the noise shaper 46 of FIG. 3 a;

FIG. 4 is a schematic representation of the voltage sensor system 34 of FIG. 2;

FIGS. 5 a-d shows, for a single period only, switching signals 24 a, 24 b for the transistors 20 a, 20 b as provided at points A and B of FIG. 1 for four different switching modes and the resultant voltage (labelled as V_(mag) for brevity) seen by the electromagnet 10; and

FIG. 6 is a schematic representation of part of a second embodiment of a current controller that can be operated in either voltage demand or current demand mode.

DETAILED DISCUSSION OF EMBODIMENTS

A current controller that may be operated in accordance with the method of the invention is illustrated in the schematic sketch of FIG. 2. As will be clear, the current controller supplies current to an electromagnet 10. The electromagnet 10 may, for example, be one of an array of such electromagnets used to levitate a raft supporting moving machinery that is subject to resonant vibrations thereby isolating the resonances from any surrounding structure.

In this embodiment, the current controller supplies electrical current to the electromagnet 10 in response to a voltage demand signal 12. The voltage demand signal 12 is generated in accordance with a desired force to be generated by the electromagnet 10. For example, the voltage demand signal 12 may be generated by a global controller (not shown) that gathers information about the vibrations of the raft supporting the moving machinery from a number of motion sensors over successive periods of time. The global controller may then determine the force that should be generated by each electromagnet 10 to reduce the resonances during each successive period. Once the force is determined, the global controller may calculate the required voltage to be applied to the electromagnet 10 for each successive period to realise the desired force and supply this to the current controller as the voltage demand signal 12. Alternatively, the global controller could supply a signal indicative of the desired force to the current controller, with the current controller calculating the corresponding voltage demand signal 12 locally.

The current supplied to the electromagnet 10 is regulated by a switching circuit in the form of a half-bridge circuit 14 that corresponds to the one shown in FIG. 1. The half-bridge circuit 14 comprises a bridge whose opposed arms have a pair of diodes 16 and a pair of transistors 20 a, 20 b. The supply input to the half-bridge circuit 14 is supplied with a DC voltage of +V_(S), obtained as a filtered DC supply 22 as will be described in more detail later. The electromagnet 10 is connected across the output of the half-bridge circuit 14.

Switching signals 24 a, 24 b are applied to the transistors 20 a, 20 b at points A, B respectively. The transistors may be of the MOSFET type, although other commonly available types are equally employable. The transistors 20 a, 20 b are run between on and off states, i.e. between states of minimum and maximum current flow, rather than using the linear region of their conductance where power losses are greater. The switching signals 24 a, 24 b control the transistors 20 a, 20 b respectively to operate the half-bridge circuit 14 in one of three modes.

In the first mode, both transistors 20 a, 20 b are switched ‘on’, i.e. into a conducting state, so that the electromagnet 10 sees a voltage of +V_(S) and current flows through the electromagnet 10 in a forward path from transistor 20 a to transistor 20 b, i.e. from right to left.

In the second mode, one of the transistors 20 a, 20 b is switched ‘on’ and the other is switched ‘off’, i.e. into a non-conducting state. As will be readily apparent, in this mode the electromagnet 10 sees a voltage of 0V and current can only flow through one loop of the half-bridge circuit 14. When transistor 20 a is switched on and transistor 20 b is switched off, current flows in the upper loop of the half-bridge circuit 14 shown in FIG. 1. Conversely, when transistor 20 b is switched on and transistor 20 a is switched off, current flows through the lower loop of the half-bridge circuit 14 of FIG. 1. However, irrespective of which transistor 20 a, 20 b is on and which is off, current always flows through the electromagnet 10 from right to left: this current will drop in magnitude according to the resistive losses in the current path.

Finally, in the third mode both transistors 20 a, 20 b are switched off. The reservoir capacitor 26 connected across the filtered DC supply 22 and the large inductance of the electromagnet 10 ensures that current flows through the electromagnet 10 along a reverse path through both diodes 16. As a result of this, the electromagnet 10 sees a voltage of −V_(S) and, again, current flows through the electromagnet 10 from right to left. This current flow will diminish in magnitude as the reservoir capacitor 26 discharges through resistive losses.

It will be appreciated that the above arrangement leads to unidirectional current flow through the electromagnet 10. Furthermore, it will be evident that this current flow may be controlled by supplying suitable switching signals 24 a, 24 b to transistors 20 a, 20 b respectively thereby to set voltages of +V_(S), 0V or −V_(S) across the electromagnet 10.

The switching signals 24 a, 24 b for each successive period of time are generated by a switching signals generator system 28 operable in response to the voltage demand signal 12. The average current flowing through the electromagnet 10 during any one period may be varied by altering the duty cycles at each of the voltage levels +V_(S), 0V or −V_(S) during the period. A maximum increase in current flow will correspond to a voltage of +V_(S) being set throughout a period and a maximum decrease in current flow will correspond to a voltage of −V_(S) being set throughout a period.

In addition to generating the switching signals 24 a, 24 b in response to the voltage demand signal 12, the switching signals generator system 28 may also take account of two further signals when generating the appropriate switching signals 24 a, 24 b. These signals are a voltage sensor signal 30 and a current sensor signal 32. The voltage sensor signal 30 is a predictive measure of voltage fluctuations in the filtered DC supply 22 provided at the input of the half-bridge circuit 14. The voltage sensor signal 30 is generated by a voltage sensor system 34 that measures fluctuations in the voltage supplied by a DC supply 36 after it has passed through a filter 38 as will be described in more detail below. Turning now to the current sensor signal 32, this signal 32 is generated by a current sensor 40 that measures the current produced by the half-bridge circuit 14 that flows through the electromagnet 10 as will be described in more detail below. Essentially, the current sensor signal 32 is used by the switching signals generator system 28 to account for voltage drops in the transistors 20 a, 20 b and slow rise and fall times in the voltage pulses seen by the electromagnet 10 due to its capacitance.

Although it is not essential for the switching signals generator system 28 to generate the switching signals 24 a, 24 b with regard to the voltage sensor signal 30 or the current sensor signal 32, far better noise control can be achieved if it is as will become evident below.

The elements of the switching signals generator system 28 will now be described in more detail. As can be seen most clearly from FIG. 3 a, the voltage demand signal 12, the voltage sensor signal 30 and the current sensor signal 32 are passed to a voltage pulse width generator 42. The voltage pulse width generator 42 calculates the required voltage pulse width 44 for the period to match the voltage demand signal 12 for that period, compensating for any predicted voltage fluctuations in the filtered DC supply 22 by reference to the voltage sensor signal 30 and for any voltage drops in the half-bridge circuit 14 by reference to the current sensor signal 32. For example, if the voltage demand signal 12 demands a voltage of ½V_(S) for the period, the voltage pulse width generator 42 will generate a pulse of +V_(S) to occupy half the period, the other half of the period being set to 0V.

The calculated voltage pulse width 44 is then passed to a noise shaper 46 where quantisation noise in the signal is shaped such that noise is suppressed at the frequencies of interest at the expense of increased noise at higher frequencies. The noise shaper 46 is shown in more detail in FIG. 3 b and will be discussed in greater detail below.

After noise shaping, the resulting voltage pulse width 48 is then passed to a switching signals pulse width generator 50 that calculates the pulse widths for each of the switching signals 24 a, 24 b passed to the transistors 20 a, 20 b. These switching signal pulse widths 52 are set to correspond to the noise shaped voltage pulse width 48 passed on by the noise shaper 46. The switching signal pulse widths 52 are calculated with respect to the current sensor signal 32 (carried through from the voltage pulse width generator 42 and the noise shaper 46) to compensate for slow rise and fall times in the voltage across the electromagnet 10 following switching of the transistors 20 a, 20 b. In addition, the switching signal pulse widths 52 are combined to give the compensated voltage pulse width 53.

Now that the switching signals' pulse widths 52 are known, they are passed on to a pulse width quantiser 54 to have the required width matched to the nearest available quantised level within the bit resolution of the quantising scheme. The quantised switching signals pulse widths 56 are used to calculate the corresponding quantised voltage pulse width 57, which will differ from the compensated voltage pulse width 53 within the limits of quantisation. The differences between the switching signals pulse widths 52 and the quantised switching signals pulse widths 56 and the compensated voltage pulse width 53 and the quantised voltage pulse width 57 are, of course, quantisation errors and they manifest themselves as quantisation noise. The quantised voltage pulse width 57 is sent back through a feedback loop 58 to the noise shaper 46 such that the quantisation noise is reduced.

The quantised switching signals pulse widths 56 are then passed to a switching signals edge position generator 60 that calculates the appropriate edge positions for the switching signals 24 a, 24 b. The calculated switching signals edge positions 62 are then converted to the actual switching signals 24 a, 24 b by a switching signals generator 64 with reference to a precision timing clock 66 thereby ensuring accuracy and synchronisation. Finally, the switching signals 24 a, 24 b are passed to the transistors 20 a, 20 b respectively at points A and B of FIG. 1 respectively. Operation of the transistors 20 a, 20 b causes the voltage across the electromagnet 10 to vary between the values of +V_(S), 0V and −V_(S) thereby forming quantised voltage pulses to match the quantised voltage pulse width 57.

The noise shaper 46 of FIG. 3 a is shown in more detail in FIG. 3 b. As can be seen, the voltage pulse width 44 is passed to a junction 68 where the noise-shaped quantisation error 70 is subtracted. In actual fact, a second-order noise-shaping scheme is used where a weighted fraction of the noise-shaped quantisation error from the last-but-one period is combined with the noise-shaped quantisation error 70 from the previous period before being subtracted. This produces a noise-shaped voltage pulse width 48 that contains a compensation for the additional voltage added or missed due to the quantisation error of the previous periods. The noise-shaped voltage pulse width 48 is then used for generating the switching signals pulse widths 52 that are used in turn to generate the quantised switching signals pulse widths 56 from which the quantised voltage pulse width 57 is deduced as described above.

The quantised voltage pulse width 57 is passed along the feedback loop 58 where it is subtracted from the compensated voltage pulse width 53 at the junction 72 to give the quantisation error 74. Following that, the quantisation error 74 is processed by a noise shaping filter 76 that uses second-order noise-shaping to suppress the quantisation noise across the frequency band of interest, as is well known in the art.

Next, the processed quantisation error 78 produced by the noise shaping filter 76 is passed through a one period delay at 80 to ensure that the processed quantisation error is subtracted from the voltage pulse width 44 for the successive period. Hence, the negative feedback loop is completed.

The voltage sensor system 34 will now be described in more detail with particular reference to FIG. 4. As mentioned above, the supply input to the half-bridge circuit 14 is supplied with a filtered DC supply 22. This is obtained from a DC supply 36 that is passed through a filter 38 to remove as much mains ripple as possible that may be present in the signal from the DC supply 36.

In addition, there will be some intermodulation of the filtered DC supply 22 due to variations in the potential across the reservoir capacitor 26 in the half-bridge circuit 14 as it charges and discharges in response to variations in current flowing through the electromagnet 10. The intermodulation will manifest themselves as an amplitude modulation in the quantised voltage pulses seen by the electromagnet 10. Clearly, deviation from the desired +V_(S), 0V or −V_(S) pulse levels will lead to the voltage demand signal 12 not being met and the current flowing through the magnet will drift from that necessary to create the intended magnetic fields (e.g. to isolate vibrations in the moving machinery).

To compensate for unwanted fluctuations in the filtered DC supply 22, a predictive voltage sensor system 34 is used. Signal-processing delays mean that direct feedthrough of fluctuations in the filtered DC supply 22 would arrive at the switching signals generator 28 too late to provide effective compensation. Hence, a the feedforward predictive voltage sensor system 34 is used. A voltage sensor 82 measures the filtered DC supply 22 as shown in FIG. 4. The reciprocal of these measurements is calculated at 84 for use by a 7-tap finite impulse response (FIR) filter 86. These components are readily available as will be appreciated by those skilled in the art. The FIR filter 86 is used to predict the likely value of 1/V_(S) across the next period and passes this value as the voltage sensor signal 30 to the switching signals generator 28 such that weight can be added or subtracted to the voltage pulse width 44 proportionate to an expected increase or decrease in voltage respectively.

The quality of control of the electromagnet 10 is also affected by the finite and non-trivial time taken for the voltage seen by the electromagnet 10 to fall upon switching off of one of the transistors 20 a, 20 b (among other factors, as will be explained below). The linear decay of the voltage is caused because the voltage can only fall as fast as the current can discharge the capacitance inherent in the electromagnet 10. The current is measured by the current sensor 40, shown in FIG. 2, and the resulting current sensor signal 32 is passed to the switching signal generator 28 so that the switching signals pulse widths 52 can be calculated to compensate for the slow decay in voltage corresponding to the current measured in the previous period.

Now that the components of the current controller have been described, there follows a presentation of the method of operation of the current controller with particular attention being paid to how the widths of the pulses in the voltage seen by the electromagnet 10 and the pulses in the switching signals 24 a, 24 b are determined.

Each period begins with a voltage demand 12 being received by the switching signals generator 28 that, in turn, calculates the required switching signals 24 a, 24 b that will produce an average voltage across the electromagnet 10 for the period to match the voltage demand 12. The switching signals generator 28 then passes the switching signals 24 a, 24 b to the transistors 20 a, 20 b respectively, correctly synchronised to the period by reference to a precision timing clock 66.

As can best be seen from FIG. 3 a, the voltage demand 12 is received by the voltage pulse width generator 42. As mentioned above, the voltage pulse width 44 in seconds is generated assuming that a single pulse of either +V_(S) or −V_(S) relative to a baseline of 0V will be used. The voltage pulse width 44 is generated with regard to fluctuations in the filtered DC supply 22, according to a predictive measure of V_(S) for the period which is supplied as the voltage sensor signal 30 which can be written as (1/V_(S))_(est).

Furthermore, account is also taken of the forward voltage drop of the diodes 16 (V_(diode)) and the transistors 20 a, 20 b. If these effects were not accounted for, an output voltage offset and change in output voltage amplitude would be seen. The voltage drop across the transistors 20 a, 20 b is known to vary significantly over typical operating conditions. To estimate the size of the voltage drop, a value of the transistors' 20 a, 20 b drain-source resistance (R_(DS)) is obtained from the corresponding device data sheet for a representative operating point. This resistance is used in conjunction with the current sensor signal 32 (which gives the current I_(mag) flowing through the electromagnet 10) to estimate the forward voltage drop of the transistors 20 a, 20 b. The value of V_(diode) is assumed to be constant across the operating conditions of the current controller and so is obtained by choosing a value representative of a typical operating point from the corresponding device data sheet.

Finally, a small DC offset voltage correction (V_(offset)) is used for fine adjustment of the output voltage: this value is obtained by calibration.

The demanded voltage 12 (V_(demand)) is adjusted by the addition of the voltage drops in the diodes 16 and transistors 20 a, 20 b and the offset voltage correction, to compensate for those losses (use of positive and negative signs for the offset ensure correct compensation). The required voltage pulse width 44 (W_(req)) can hence be calculated from:

$\begin{matrix} \begin{matrix} {W_{req} = {\left( {V_{demand} + V_{diode} + {I_{mag} \cdot R_{DS}} + V_{offset}} \right) \cdot}} \\ {\left( \frac{1}{V_{S}} \right)_{est} \cdot W_{full}} \end{matrix} & {{equation}\mspace{20mu}(1)} \end{matrix}$ where W_(full) is the maximum pulse width in seconds. In this example, a pulse repetition frequency of 64 kHz was used and the frequency of the timing clock was 32.768 MHz giving a period width of 15.625 μs. Of course, other pulse repetition frequencies can be substituted depending on noise demands and expense or availability of components to cope with higher frequencies.

It will be noted from equation (1) that the voltage pulse width 44 will carry a sign reflecting the polarity of the voltage demanded, i.e. it will be positive for voltage demands 12 in the range 0V to +V_(S) and negative for voltage demands 12 in the range 0V to −V_(S). This sign is carried throughout the subsequent calculations. Furthermore, the voltage pulse width 44 is a measure of the time away from the 0V base line and hence is the width of the pulse at +V_(S) and the pulse at −V_(S).

Whilst equation (1) leads to a high level of accuracy, not all or any of the terms contained in the first set of brackets (other than V_(demand)) need be included where a reduction in the performance of the electromagnet 10 can be tolerated.

The voltage pulse width 44 is then passed to the noise shaper system 46 to produce a noise-shaped voltage pulse width 48 (W_(sh)). This is calculated with reference to the quantisation error in the width of the previous period's pulse (W_(QE-1)) and also with reference to the quantisation error in the width of the last-but-one period's pulse (W_(QE-2)) as mentioned above. The noise-shaped voltage pulse width 48 is given by:

$W_{sh} = {W_{req} - {2{{\cos\left( \frac{2{\pi \cdot f_{notch}}}{f_{PRF}} \right)} \cdot W_{{QE} - 1}}} + W_{{QE} - 2}}$ where f_(PRF) is the pulse repetition frequency (64 kHz, as mentioned above) and where f_(notch) is the chosen frequency for the inevitable notch in the noise spectrum of the shaped noise. In the present embodiment, this was chosen to be 1 kHz.

The noise-shaped voltage pulse width 48 is then passed to the switching signals pulse width generator 50 that generates the corresponding widths for the pulses in the switching signals 24 a, 24 b. However, there are four modes of switching the transistors 20 a, 20 b and the correct mode must be implemented. Accordingly, these four modes are now detailed with reference to FIGS. 5 a-d. To summarise what has been discussed previously in this respect, the following voltages are seen by the electromagnet 10 when the transistors 20 a, 20 b are switched as follows:

transistor states voltage both on +V_(s) one on, one off 0 V both off −V_(s)

FIG. 5 a shows the switching sequence where the voltage demand 12 is for a positive voltage, i.e. in the range of 0 to +V_(S). To avoid the power losses inherent in each switching operation of either transistor 20 a, 20 b, the default switching mode is a so-called ‘class B’ mode where only one transistor 20 a is switched during a period whilst the other transistor 20 b is left in its on state throughout the period. In this way, no power is lost in transistor 20 b due to switching. In addition, in many types of application the voltage demand 12 is likely to remain positive or negative for many successive periods so that one transistor 20 a, 20 b can be left in a steady state over those periods thereby avoiding any power loss inherent in switching that transistor 20 a, 20 b. As can be seen, a single pulse in switching signal 24 a is generated centrally within the period to provide a voltage across the electromagnet 10 with a single corresponding pulse of +V_(S) (hatched in FIG. 5 a) rising from a baseline of 0V to give the demanded positive voltage.

FIG. 5 b shows a second mode of operation corresponding to a voltage demand 12 for a negative voltage, i.e. in the range of 0 to −V_(S). Again, class B switching of the transistors 20 a, 20 b is used, this time with transistor 20 a being left in an off state throughout the period and transistor 20 b being switched with its switching signal 24 b having a central pulse within the period. The resulting voltage seen by the electromagnet 10 has a pair of −V_(S) pulses extending from the 0V baseline at the beginning and end of the period. Hence, the two pulses hatched in FIG. 5 b combine to form the required negative voltage pulse. Therefore it is not the central pulse of switching signal 20 b that gives the −V_(S) pulse, but rather the peripheral regions. Accordingly, it is the full width of the period less the width of the central pulse in the switching signal 24 b that corresponds to the width of the −V_(S) pulse in the voltage seen by the electromagnet 10. It will be appreciated that, as above, a transistor (20 a in this case) can be left in a steady state where successive negative voltages are demanded.

Strictly speaking, a further mode ought to be mentioned for the sake of completeness, namely that arising when a zero voltage is demanded. This can be implemented by leaving transistors 20 a off and 20 b on throughout the period.

Whilst class B switching is preferred due to the reduction in power losses in having to switch both transistors 20 a and 20 b within a period, a conflicting demand arises where small positive or small negative voltages are demanded. In the case of a small positive voltage, this leads to a narrow pulse in the voltage seen by the electromagnet 10 such that the voltage must rapidly step up to +V_(S) then down to 0V. In the case of a small negative voltage, the problem lies in the start and end of successive periods where the voltage must rapidly step down to −V_(S) then up to 0V. Slow response of the transistors 20 a, 20 b and ringing adds distortion to the square edges of the pulses leading to a lack of voltage control. These effects become problematic for a characteristic small pulse width where the steady flat region between ringing waveforms is lost. This leads to a loss of linearity in the current controller. To overcome this problem, a threshold pulse width W_(thresh) is set and when a pulse width below this is required to meet a voltage demand 12, switching changes to so-called ‘class AB’ mode where both transistors 20 a, 20 b are switched in a period.

FIG. 5 c shows a case of class AB switching for a small positive voltage demand 12. If implemented using class B switching, a single pulse in the voltage seen by the electromagnet 10 would arise that is below the threshold width. To avoid this, the transistor 20 a is switched to produce a central on pulse with the a width equal to the threshold width plus the demanded width and, rather than leaving the transistor 20 b in its on state throughout the period, it is switched to produce a central on pulse occupying most of the period. The resulting potential seen by the electromagnet 10 starts and ends with small downwardly-extending pulses at −V_(S) where both transistors 20 a, 20 b are off (indicated by the unbroken hatched areas) which steps to regions at 0V where transistor 20 b is on and transistor 20 a is off, these regions meeting at a central pulse at +V_(S) where both transistors 20 a, 20 b are on (indicated by the broken hatched area). The widths of the hatched areas have been exaggerated for the sake of clarity and should not be used to gauge actual threshold widths. The average potential seen by the electromagnet 10 over the period corresponds to the broken hatched area less the unbroken hatched areas which clearly results in a net small positive voltage.

In a similar vein, FIG. 5 d shows the case of class AB switching in response to a small negative voltage demand 12 that, if class B switching were to be used, would result in a width of the −V_(S) pulse between successive periods that is below the threshold width. To maintain the minimum −V_(S) pulse width, transistor 20 b is switched to have an on pulse extending centrally over most of the period. Transistor 20 a, rather than being left in an off state as in class B switching, is switched to have a central on pulse. The resulting potential seen by the electromagnet 10 has a shape corresponding to that described above with reference to FIG. 5 c, except that now the unbroken hatched areas corresponding to −V_(S) combine to be larger than the broken hatched area corresponding to +V_(S), hence resulting in the electromagnet 10 seeing a small negative average potential.

Accordingly, the type of switching mode is determined by testing the following conditions: W_(sh)≧0  condition (1) |W _(sh) |−W _(cap) ≧W _(thresh)  condition (2) where W_(cap) is a width adjustment calculated to compensate for capacitance in the electromagnet 10 (C_(mag)). This capacitance causes slow rise and fall times between the voltage levels seen by the electromagnet 10, as mentioned above, and so has the effect of artificially lengthening the pulses. Hence, control is lost. The width adjustment is calculated from:

$W_{cap} = \frac{C_{mag}}{2{MAX}\left\{ {I_{mag},I_{\min}} \right\}}$ where the largest of the current through the electromagnet 10 (I_(mag)) or a minimum current value (I_(min)) is used. The minimum current value corresponds to a lower limit of current used in this calculation to avoid dividing by zero and other problems encountered where only small currents flow through the electromagnet 10.

The type of switching appropriate for the outcome of testing conditions (1) and (2) is presented below:

condition (1) condition (2) switching mode illustrated in yes yes +class B FIG. 5a no yes −class B FIG. 5b yes no +class AB FIG. 5c no no −class AB FIG. 5d

The switching signal pulse widths 52 are then calculated for the appropriate switching modes as follows. In the equations below, W_(A) and W_(B) are the widths of the pulses of switching signals 24 a and 24 b respectively. W_(EA) and W_(EB) are the net effective errors in the actual width of the pulses generated in response to the switching signals 24 a and 24 b respectively (the values are determined through calibration). W_(min) is a fixed offset to be added when in class AB mode.

+Class B W _(A) =|W _(sh) |−W _(cap) −W _(EA) W_(B)=W_(full)

-   -   i.e. transistor 20 a has a pulse of the noise shaped voltage         pulse width 48 less compensation for capacitance and net         effective errors, whilst transistor 20 b remains on throughout         the period.         −Class B         W_(A)=0         W _(B) =W _(full) −|W _(sh) |−W _(cap) −W _(EB)     -   i.e. transistor 20 a remains off throughout the period, whilst         transistor 20 b has a central pulse equal to the full period         width less the noise shaped voltage pulse width 48 (remembering         that the noise shaped voltage pulse width 48 reflects the         voltage pulse width at −V_(S) whereas we are now setting a width         for a pulse in the switching signal generating the central         region at 0V) and also less compensation for capacitance and net         effective errors.         +Class AB         W _(A) =|W _(sh)|+(W _(min) +W _(cap))−W _(cap) −W _(EA)         W _(B) =W _(full)−(W _(min) +W _(cap))−W _(cap) −W _(EB)     -   i.e. transistor 20 a has a pulse of the noise shaped voltage         pulse width 48 plus the fixed offset to ensure the threshold         width is exceeded less compensation for capacitance and net         effective errors, whilst transistor 20 b remains on throughout         the period less the fixed offset to ensure no net gain in output         voltage across the electromagnet 10 and less compensation for         capacitance and net effective errors.         −Class AB         W _(A)=(W _(min) +W _(cap))−W _(cap) −W _(EA)         W _(B) =W _(full) −|W _(sh)|−(W _(min) +W _(cap))−W _(cap) −W         _(EB)     -   i.e. similar to the case of −class B switching, but now         transistor 20 a contains a pulse with the fixed offset width         less compensation for capacitance and net effective errors,         whilst transistor 20 b has a reduction in width in its central         pulse corresponding to the fixed offset to ensure a minimum gap         between voltage changes between periods.

The switching signals pulse widths 52 have now been calculated, but these widths 52 are in seconds and can take any value in the range of 0 s to the full width of the period (the reciprocal of the pulse repetition frequency, i.e. 15.625 μs). However, as the final switching signals are pulse width modulated, the switching signals pulse widths 52 must be converted to cycle counts of the precision timing clock 66 such that they are quantised to match the number of available cycle counts in one period (it has been noted above that the combination of pulse repetition frequency and precision timing clock 66 frequency f_(clock) gives 512 cycle counts per period). This function is performed by the switching signals pulse width quantiser 54.

The switching signals pulse width quantiser 54 calculates the number of cycle counts (N_(A) and N_(B) for transistors 20 a and 20 b respectively) from the simple formulae below and passes these values on as the quantised switching signals pulse widths 56. N _(A)=|round(f _(clock) ·W _(A))| N _(B)=|round(f _(clock) ·W _(B))| N_(A) and N_(B) are also used to calculate the quantisation error 74 (WOE) according to the formula:

$W_{QE} = {\left( {\frac{N_{A}}{f_{clock}} - W_{A}} \right) + \left( {\frac{N_{B}}{f_{clock}} - W_{B}} \right)}$ W_(QE) is then used as W_(QE-1) and W_(QE-2) in following periods, as described above.

With the quantised switching signals pulse widths 56 known in units of cycle counts of the precision timing clock 66, the switching signals edge position generator 60 generates the precise cycle counts where the edges of the pulses of the switching signals 24 a, 24 b will occur.

The pulses are positioned using alternate-odd-asymmetry in order to minimise signal distortion. This distortion arises from where pulses of an odd number of cycle counts are needed. Such pulses cannot be positioned centrally within the period given the constraint that the edges must coincide with the start and end of cycle counts. If the pulses were always positioned to be half a cycle early or half a cycle late, distortion would result. This distortion is minimised by using alternate odd asymmetry, i.e. by alternating the offset between the leading and trailing edge halves of the period. Put into algorithms, the on edge position and off edge positions for transistor 20 a are given by: if N_(A) is even then: ON_(A)=½(N _(full) −N _(A)) else: ON_(A)=½(N _(full) −N _(A) +d _(A)) and d _(A) =−d _(A) and: OFF_(A)=ON_(A) +N _(A) where N_(full) is the maximum number of cycle counts (512) and d_(A) is initially set to +1 and its value is carried through from one period to the next. As will be appreciated, the edge positions for transistor 20 b are determined in corresponding fashion (i.e. with the ‘A’ subscripts swapped for ‘B’ subscripts).

With the edge positions of the pulses in the switching signals 24 a, 24 b known, these values are passed to the switching signals generator 64 as the switching signals edge positions 62. The switching signals generator 64 then synchronises the switching signals edge positions 62 to the cycle counts of the precision timing clock 66 to produce the actual switching signals 24 a, 24 b which are then passed to the transistors 20 a, 20 b respectively.

Hence, the half-bridge circuit 14 is operated to produce an average voltage across the electromagnet 10 corresponding to the voltage demand 12.

The person skilled in the art will appreciate that modifications can be made to the embodiments described hereinabove without departing from the scope of the invention.

For example, the above embodiment describes a current controller that supplies current to the electromagnet 10 in response to a voltage demand signal 12 that may be generated in accordance with a desired force by a global controller. However, the current controller may operate in response to a current demand signal 88 rather than a voltage demand signal 12. This signal may be generated by the global controller in much the same way as described with respect to generation of the voltage demand signal 12 of the first embodiment.

Such an arrangement is shown in FIG. 6: this Figure is equivalent to FIG. 2 but shows the additional elements required to operate in a current demand mode. Whilst all elements from FIG. 2 (and those shown in detail in FIGS. 3 and 4) would be included in the current controller, only those relevant to this discussion of the current demand mode are shown in FIG. 6 for the sake of clarity. As will be evident, the major change is the inclusion of a control loop indicated generally at 87.

In one mode of operation, current demand signal 88 (labelled as 88 a for the sake of clarity) is compared with the current sensor signal 32 at a comparator 90. The current sensor signal 32 is derived from the output of the current sensor 40 and provides a measure of the current passing through the electromagnet 10. Comparing the current sensor signal 32 with the current demand signal 88 a provides an error signal 92 that represents deviation in current through the electromagnet 10 away from the demanded current. The error signal 92 is passed to a filter 94 that incorporates control loop gain, a control loop filter and a current-to-voltage transfer model to produce voltage demand signal 12 a. The voltage demand signal 12 a is passed to the switching signals generator system 28 via a three-way switch 96.

Inaccuracies in the current-to-voltage transfer model are compensated by the control loop 87 using the current sensor 40. The performance of the current controller is dependent more on the noise performance and accuracy of the current sensor 40 than the accuracy of the current-to-voltage transfer model. If necessary, a combination of current sensors may be used, to give the best dynamic range for example.

In an alternative mode of operation where the control loop 87 that compensates for drifts in electromagnet current (via current sensor signal 32) is not required, the current demand signal 88 can be passed directly at 88 b to a voltage demand generator 100, as shown in FIG. 6. The voltage demand generator 100 generates the voltage demand signal 12 b by using a filter containing a model of the electromagnet load characteristic so that the voltage demand generator 100 can predict the appropriate voltage demand necessary to produce the required current demand 88. The voltage demand signal 12 b is passed to the switching signals generator system 28 via a three-way switch 96. Of course, the accuracy of the eventual current passed to the electromagnet 10 is heavily dependent upon the accuracy of the load model generating the voltage demand signal 12 b.

If desired, the current controller can be adapted to operate in either voltage demand or current demand mode. For example, the three-way switch 96 could be used to switch between the voltage demand input 12 a provided by the filter 94 or the voltage demand input 12 b provided by the voltage demand generator 100 or a direct voltage demand input 12 c (i.e. a line carrying a voltage demand direct from a global controller or similar) to produce the voltage demand signal 12 passed to the switching signals generator system 28. 

1. A pulse width modulation switching circuit, responsive to a voltage demand signal, for controlling current supplied to an inductor from a direct current (DC) supply voltage, said switching circuit comprising: a bridge circuit, said bridge circuit comprising: an input operable to receive a direct current, DC, supply of nominal voltage +V_(S), an output connected to said inductor, said output having opposed ends; and first and second bridge arms, said arms having corresponding first and second switches operable in response to first and second switching signals to be switched between on and off states, wherein switching between various combinations of on and off states produces an electrical signal at the opposed ends of said output with voltage pulses at levels of nominally +V_(S), 0V, and −V_(S); a voltage sensor for producing a signal indicative of said DC supply voltage; and a switching signal generator, responsive to said DC supply voltage signal and said voltage demand signal, for generating said first and second switching signals.
 2. A switching circuit according to claim 1, further comprising a current sensor for producing a signal indicative of the current flowing through the output.
 3. A switching circuit according to claim 1, wherein the bridge circuit is a half-bridge with the third and fourth arms having diodes.
 4. A switching circuit according to claim 1, wherein the first and second switches are transistors.
 5. A switching circuit according to claim 1, wherein said inductor comprises an electromagnet connected across the output of the bridge circuit.
 6. A method of pulse width modulation control of a bridge circuit comprising an input that receives a DC supply of nominal voltage +V_(S), an output having an electromagnet connected thereacross, and having first and second switches, respectively, wherein first and second arms of said bridge circuit are connected to opposing ends of the electromagnet, the method comprising the steps of: (a) receiving a voltage demand signal indicative of a desired voltage of an electrical signal to be supplied to the electromagnet in a pulse width modulation period; (b) generating first and second switching signals with reference to the voltage demand signal and with reference to an indication of the DC supply voltage; and (c) applying the first and second switching signals to the first and second switches, respectively, during said period; wherein the switching signals cause the switches to switch between on and off states, switching between various combinations of on and off states of the first and second switches producing within the period an electrical signal across the electromagnet with voltage pulses at levels selected from any of +V_(S), 0V and −V_(S), the first and second switching signals being generated such that an average voltage of the electrical signal supplied to the electromagnet during the period is substantially equal to the desired voltage.
 7. The method of claim 6, wherein at least one of the first and second switching signals is generated with reference to a voltage signal indicative of the DC supply such that the at least one first or second switching signal compensates for fluctuations in the DC supply.
 8. The method of claim 7, wherein the voltage signal is passed through a filter to obtain a predictive measure of fluctuations in the DC supply.
 9. The method of claim 8, wherein the voltage signal is passed through a finite impulse response filter.
 10. The method of claim 6, wherein at least one of the first and second switching signals is generated to compensate for a voltage drop across a diode and/or transistor in the switching circuit.
 11. The method of claim 10, wherein the at least one first or second switching signal is generated with reference to a current signal indicative of the current flowing through the output and a representative resistance of the diode or transistor.
 12. The method of claim 6, wherein at least one of the first or second switching signals is generated with reference to a measure of a voltage offset caused by a slow response in generating the first or second switching signals.
 13. The method of claim 6, wherein the switching circuit comprises a bridge circuit having an input that receives the DC supply, an output and first and second arms having first and second switches respectively, the first and second arms being connected to opposed ends of the output.
 14. The method of claim 13, wherein the bridge circuit is a half-bridge with the third and fourth arms having diodes.
 15. The method of claim 13, wherein the first and second switches are transistors and the method comprises the step of switching the transistors between on and off states corresponding to substantially minimum voltage drop and substantially minimum current flow, respectively, through the transistors.
 16. The method of claim 6 comprising the step of generating pulsed first and second switching signals.
 17. The method of claim 16 comprising the step of generating the first and second switching signals according to a rule that the first and second switches are not switched concurrently.
 18. The method of claim 16 comprising the step of generating the first and second switching signals according to a rule that the signals are to have no more than one pulse per period.
 19. The method of claim 18 comprising the step of generating the first and second switching signals according to a rule that any pulse should be positioned symmetrically about the centre of the period.
 20. The method of claim 16 comprising the step of generating the first and second switching signals according to a pulse width modulation scheme.
 21. The method of claim 16 comprising the step of noise shaping the first and second switching signals.
 22. The method of claim 6 comprising the step of receiving a current demand signal indicative of a desired current to be supplied to the output in a period and calculating the voltage demand signal indicative of a desired voltage of an electrical signal to be supplied to the output that results in the electrical signal being supplied to the output during the period with a current substantially equal to the desired current.
 23. The method of claim 22, wherein the step of calculating the voltage demand signal is performed with reference to a model of the load characteristic of a load connected to the output.
 24. The method of claim 22 further comprising the step of generating the voltage demand signal with reference to a current signal indicative of the current flowing through the output.
 25. A computer program comprising program code means for performing the method steps of claim 6 when the program is run on a computer associated with the switching circuit.
 26. A computer program product comprising program code means stored on a computer readable medium for performing the method steps of claim 6 when the program is run on a computer associated with the switching circuit.
 27. The method of claim 6, wherein, when the desired voltage is of less than a predetermined magnitude, the first and second switching signals are generated such that the electrical signal comprises voltage pulses of both V_(S) and −V_(S) within the period.
 28. The method of claim 6, wherein, when the desired voltage is of at least predetermined magnitude, the first and second switching signals are generated such that the electrical signal comprises voltage pulses of either V_(S) or −V_(S) within the period.
 29. A method of operating a switching circuit comprising an input that receives a DC supply of nominal voltage +V_(S), an output and first and second switches, the method comprising the steps of: (a) receiving a voltage demand signal indicative of a desired voltage of an electrical signal to be supplied to the output in a period; (b) generating first and second switching signals with reference to the voltage demand signal and with reference to an indication of the DC supply voltage; and (c) applying the first and second switching signals to the first and second switches respectively during the period; wherein the switching signals cause the switches to switch between on and off states, switching between various combinations of on and off states of the first and second switches producing an electrical signal at the output with voltage pulses at levels of nominally +V_(S), 0V and −V_(S), the first and second switching signals being generated such that an average voltage of the electrical signal supplied to the output during the period is substantially equal to the desired voltage, wherein the step of generating first and second switching signals comprises generating pulsed first and second switching signals, generating said pulsed first and second switching signals according to a rule that the signals are to have no more than one pulse per period and generating the first and second switching signals according to the rule that where pulses cannot be centred symmetrically, the longer and shorter sides of the asymmetric pulses are alternated between the leading edge side and the trailing edge side for successive pulses.
 30. A pulse width modulation controller for an electromagnet comprising: a supply input for providing a DC supply of nominal voltage V_(S); a bridge circuit comprising first and second arms having first and second switches respectively, the first and second arms being connected to opposed ends of the electromagnet; a voltage demand signal indicative of a desired voltage to be supplied to the electromagnet in a pulse width modulation period; a switching signal generator configured to generate first and second switching signals with reference to the voltage demand signal and to apply the first and second switching signals to the first and second switches, respectively, during said pulse width modulation period; wherein said first and second switching signals cause the switches to switch between on and off states and producing within the pulse width modulation period an electrical signal across the electromagnet with voltage pulses at levels selected from any of V_(S), 0V and −V_(S).
 31. The controller of claim 30 wherein the switching signal generator is configured, when the desired voltage is of less than a predetermined magnitude, to generate the first and second switching signals to provide the electrical signal comprising voltage pulses of both V_(S) and −V_(S) within the period.
 32. The controller of claim 30 wherein the switching signal generator is configured, when the desired voltage is of at least a predetermined magnitude, to generate the first and second switching signals to provide the electrical signal comprising voltage pulses of either V_(S) or −V_(S) within the period. 